package com.abe.libcore;

import android.content.Context;
import android.support.multidex.MultiDexApplication;

import com.abe.libcore.utils.Utils;
import com.abe.libcore.utils.normal.CrashHandler;

public class BaseApplication extends MultiDexApplication {

    private static BaseApplication application;

    @Override
    public void onCreate() {
        super.onCreate();
        application = this;
        //工具集合
        Utils.init(this);
        //日志捕捉
        CrashHandler crashHandler = CrashHandler.getInstance();
        crashHandler.init(this);
    }

    public static BaseApplication getInstance() {
        if (null == application) {
            application = new BaseApplication();
        }
        return application;
    }

    public static Context getContext() {
        return getInstance().getApplicationContext();
    }
}

